<style type="text/css">
    .page-header .left {
        width: calc(100% - 220px);
    }

    @media only screen and (max-width: 479px) and (min-width: 320px) {
        .page-header .left {
            width: 100%;
        }
    }
</style>
<div id="content">
    <div class="row s_page_title">
        <sa-big-breadcrumbs [items]="['运维管理[环卫]','算法异常日志']" icon="fa fa-newspaper-o"
            class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
        <div class="s_table">
            <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>算法异常日志</h2>
                </header>
                <div>
                    <div class="widget-body no-padding">
                        <div class="page-header clearfix s_table_opreation">
                            <div class="left page-header-btn">
                                <sa-company-tree-car companyTreeId="ProblemcompanyTree"
                                    tcarNumberSelect2="ProblemCarNumberSelect2" wrapId="content" [isShowCarSort]="false"
                                    sourceCarUrl="carInfo/queryCarNumber.html" typeFlag="2" [isShowCarNum]="true"
                                    (companySelected)="companySelected($event)" [companyData]="inputCompanyTreeCarData">
                                </sa-company-tree-car>
                                <div class="selectDate top_module">
                                    <table-select-date [notInit]='true' [specifyId]='specifyId2'
                                        [specifyTime]='specifyTime2' (outerTime)="getSelectTableTime($event)">
                                    </table-select-date>
                                </div>
                                <button class="btn btn-primary" (click)="table_search()">查询</button>
                                <button class="btn btn-primary" type="button" (click)="exprotData()">导出</button>
                            </div>
                        </div>
                        <div class="tabbable">
                            <div class="tab-content" style="padding:0;border:none">
                                <div id="sensor" class="tab-pane active">
                                    <div class="table_scroll">

                                        <table
                                            class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                            <thead>
                                                <tr>
                                                    <th>设备ID</th>
                                                    <th>车牌号码</th>
                                                    <th>公司名称</th>
                                                    <th>问题</th>
                                                    <th>异常开始时间</th>
                                                    <th>异常结束时间</th>
                                                    <th>操作时间</th>
                                                    <th>操作人</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr *ngFor="let row of tableData">
                                                    <td>{{row.deviceId}}</td>
                                                    <td>{{row.carNumber}}</td>
                                                    <td>{{row.companyName}}</td>
                                                    <td>
                                                        <div *ngIf="row.newProblem&& row.newProblem.length > 0">
                                                            <span
                                                                *ngFor="let item of row.newProblem,let i = index">{{item}}<span
                                                                    *ngIf="i < row.newProblem.length - 1">,</span></span>
                                                        </div>
                                                        <div *ngIf="row.newProblem&& row.newProblem.length == 0">
                                                            <span>无异常</span>
                                                        </div>
                                                    </td>
                                                    <td>{{row.sanitationProblemEntity.startTime}}</td>
                                                    <td>{{row.sanitationProblemEntity.endTime}}</td>
                                                    <td>{{row.operatingTime}}</td>
                                                    <td>{{row.operator}}</td>

                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="table-fix clearfix">
                                        <paginator [totalRecords]="totalCount" [rows]="pageSize"
                                            [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                                        </paginator>
                                        <button type="button" class="btn default refresh_btn" (click)="refresh()"><i
                                                class="fa fa-refresh"></i></button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </sa-widgets-grid>

</div>
<!-- 查看回复详情   弹窗-->
<section bsModal #analyseMangeModal="bs-modal" class="modal fade" role="dialog" tabindex="-1"
    aria-labelledby="myLargeModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" (click)="itemModalClose(analyseMangeModal)" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">故障详情</h4>
            </div>
            <div class="modal-body">
                <div class="row form-horizontal">
                    <div class="table_scroll" *ngIf="sensorProblemList && sensorProblemList.length != 0">
                        <div class="title" style="font-size: 15px;margin-bottom: 10px;">传感器详细问题</div>
                        <table
                            class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                            <thead>
                                <tr>
                                    <th>问题描述</th>
                                    <th>开始时间</th>
                                    <th>结束时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>

                                <tr *ngFor="let row of sensorProblemList">
                                    <td>{{row.sensorProblem}}</td>
                                    <td>{{row.startTime}}</td>
                                    <td>{{row.endTime}}</td>
                                    <td>
                                        <button type="button"
                                            (click)="showDataModal(row,analyseMangeModal)">分析处理</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="table_scroll" style="margin-top: 20px;"
                        *ngIf="gpsProblemList && gpsProblemList.length != 0">
                        <div class="title" style="font-size: 15px;margin-bottom: 10px;">GPS详细问题</div>
                        <table
                            class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                            <thead>
                                <tr>
                                    <th>问题描述</th>
                                    <th>开始时间</th>
                                    <th>结束时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>

                                <tr *ngFor="let row of gpsProblemList">
                                    <td>{{row.gpsProblem}}</td>
                                    <td>{{row.startTime}}</td>
                                    <td>{{row.endTime}}</td>
                                    <td>
                                        <button type="button"
                                            (click)="showDataModal(row,analyseMangeModal)">分析处理</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- 查看回复详情 弹窗end-->

<!-- 数据分析处理   弹窗-->
<div id="analyseModal">

    <div class="modal-dialog modal-lg" style="width: 1400px;margin: 0;">
        <div class="modal-content">
            <div class="modal-header" id="analyseModalheadDrag">
                <button type="button" class="close" (click)="cancelAnalyseModal()" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">数据分析处理</h4>
            </div>
            <div class="modal-body" style="padding: 0;background-color: #ffffff;">
                <sa-problem-analyse #analyseComponent [isShowTitle]="false" [dayNum]="3"></sa-problem-analyse>
            </div>
        </div>
    </div>


    <div style="position: absolute;right: 1px; bottom: 1px;width: 30px;height: 24px;">
        <button class="dragBtn btn btn-primary" id='dragArrow' title="拖拽改变弹窗宽度"> ↔ </button>
    </div>
</div>
<!-- 数据分析处理 END -->